package com.usooft.metaTalent.core.system.service;

import com.usooft.framework.core.query.Page;
import com.usooft.metaTalent.core.system.entity.Employee;
import com.usooft.metaTalent.core.system.query.EmployeeQuery;
import com.usooft.metaTalent.core.system.wrapper.EmployeeWrapper;
import org.springframework.lang.NonNull;
import java.util.List;
import java.util.Optional;
import java.lang.Long;
import java.lang.String;

public interface EmployeeService {

    // region 自动生成
    Employee get(Long id);

    Optional<Employee> find(Long id);

    List<EmployeeWrapper> list(EmployeeQuery query);

    Page<EmployeeWrapper> page(EmployeeQuery query);

    int count(EmployeeQuery.Filter filter);

    /**
     * 根据指定的手机号查找员工
     *
     * @param phoneNumber 手机号
     * @return 员工
     */
    Optional<? extends Employee> findByPhoneNumber(@NonNull String phoneNumber);
    // endregion

    Employee createAdmin(String name,
                         String phoneNumber,
                         String password);

    boolean matchPassword(Employee employee, String password);

    String resetPassword(Employee employee);

    Employee create(String name, String phoneNumber, String gender, Boolean locked);

    void edit(Employee employee, String name, String phoneNumber, String gender, Boolean locked);

    void lock(Employee employee);

    void unlock(Employee employee);

    void changePassword(Employee employee, String originalPassword, String newPassword);
}